package org.wangp.montior.log.repository.es.domain

import cn.hutool.core.date.DatePattern
import com.fasterxml.jackson.annotation.JsonFormat
import org.springframework.data.annotation.Id
import org.springframework.data.elasticsearch.annotations.DateFormat
import org.springframework.data.elasticsearch.annotations.Field
import org.springframework.data.elasticsearch.annotations.FieldType
import org.wangp.framework.elasticsearch.domain.BaseDOEs
import java.time.LocalDateTime
import java.util.*

/**
 * @author wangpeng (๑•ᴗ•๑)
 * @since 2021/10/15 3:42
 */
// @Document(indexName = "ftkjwlhypt_log", createIndex = true)
data class LogDoEs(
	@Id
	var esId: String? = null,
	@Field
	var lId: Long? = null,
	@Field(type = FieldType.Date, format = DateFormat.custom, pattern = DatePattern.NORM_DATETIME_PATTERN)
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GTM+8")
	var createTime: LocalDateTime? = null,
	@Field
	var description: String? = null,
	@Field
	var exceptionDetail: String? = null,
	@Field
	var logType: String? = null,
	@Field
	var method: String? = null,
	@Field
	var params: String? = null,
	@Field
	var requestIp: String? = null,
	@Field
	var time: Long? = null,
	@Field
	var username: String? = null
) : BaseDOEs()
